package com.sxt.pro.service.impl;

import java.util.Date;
import java.util.List;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.sxt.pro.mapper.SourcesMapper;
import com.sxt.pro.pojo.Sources;
import com.sxt.pro.service.SourcesService;

/**  

* @Description: 素材实现层

* @author xinxiaokang  

* @date 2020年12月3日 上午9:12:37

*/
@Service
@Transactional
public class SourcesServiceImpl extends ServiceImpl<SourcesMapper, Sources> implements SourcesService{

	/**
	 * 批量审批
	 */
	@Override
	public void batchUpdateSourcesList(int available, Integer id) {
		this.getBaseMapper().batchUpdateSourcesList(available,id);
		
	}

	/**
	 * 批量取消审批
	 */
	@Override
	public void batchOffupdateSourcesList(int available, Integer id) {
		this.getBaseMapper().batchOffupdateSourcesList(available,id);
		
	}

	/**
	 * 随机获取5条素材
	 */
	@Override
	public List<Sources> sendSourcesDataByter(String terminal_no, int available) {
		return this.getBaseMapper().sendSourcesDataByter(terminal_no,available);
	}

	/**
	 * 添加时：判断此设备素材中时间段是否有重合
	 */
	@Override
	public int countTime(Date dateLeft, Date dateRight, String terminal_no) {
		return this.getBaseMapper().countTime(dateLeft,dateRight,terminal_no);
	}

	/**
	 * 修改时：判断此设备素材中时间段是否有重合
	 */
	@Override
	public int countTimeById(Date dateLeft, Date dateRight, String terminal_no, Integer id) {
		return this.getBaseMapper().countTimeById(dateLeft,dateRight,terminal_no,id);
	}

	/**
	 * 获取添加的id
	 */
	@Override
	public int saveToId() {
		return this.getBaseMapper().saveToId();
	}

	

}
